pub trait ExtractJsonValue {
    fn get_string_value(&self, key: &str) -> Option<String>;
    fn get_str_value(&self, key: &str) -> Option<&str>;
}

impl ExtractJsonValue for serde_json::Value {
    fn get_str_value(&self, key: &str) -> Option<&str> {
        self.get(key).and_then(serde_json::Value::as_str)
    }

    fn get_string_value(&self, key: &str) -> Option<String> {
        self.get_str_value(key).map(|p| p.to_string())
    }
}
